import React from "react";
import { useNavigate } from "react-router";
import { useAppDispatch } from "../../redux";
import { setIsLogin } from "../../redux/privates/userInfoSlice";

const UserPage:React.FC=()=>{
    const navigate = useNavigate()
    const dispatch = useAppDispatch()
    const logOut=()=>{
        localStorage.removeItem("userToken")
        dispatch(setIsLogin(false))
        navigate("/")
    }


    return (
        <main>
            个人主页
            <div>
                <span onClick={logOut}>退出登录</span>
            </div>
        </main>
    )
}
export default UserPage